#include<iostream>
#include<algorithm>

using namespace std;

// typedef long long ll;

 const int N  = 1e7+9;

int n,m,p; 
int fa[N];

int find(int x){
	if(x==fa[x]){
		return x;
	}
	else{
		return fa[x] = find(fa[x]); 
	}
}

void merge(int x,int y){
	fa[find(x)]=find(y);
} 

void solve(){
    
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

	cin>>n>>m>>p;
	for(int i=1;i<=n;i++){
		fa[i]=i;
	}
	while(m--){
		int x,y;
		cin>>x>>y;
		merge(x,y);
	}
	
	while(p--){
		int x,y;
		cin>>x>>y;
		if(find(x)==find(y)){
			cout<<"Yes"<<"\n";
		}else{
			cout<<"No"<<"\n";
		}
	}

    solve();

    return 0;
}
